import service from '@/utils/request'
import qs from 'qs'

export const useProjectReports = (pageParams: { page: number; limit: number; projectId: number }) => {
	return service.get('project/projectReport/page', {
		params: {
			page: pageParams.page,
			limit: pageParams.limit,
			projectId: pageParams.projectId
		},
		paramsSerializer: params => {
			return qs.stringify(params)
		}
	})
}

export const updateReport = (reportData: any) => {
	return service.post('project/projectReport/report', { ...reportData, progressReport: reportData.weeklyProgress })
}
